<?php
declare(strict_types=1);

namespace LowCode\Naive;

use LowCode\Naive;
use LowCode\Support\JsExp;

/**
 * CollapseTransition 组件
 * @method static static make(mixed $children = null) CollapseTransition 组件
 */
class CollapseTransition extends Naive
{

    /**
     * @param mixed|null $children
     */
    public function __construct(mixed $children = null)
    {
        parent::__construct();
        $this->children($children);
    }

    /**
     * 是否在首次出现时播放动画
     * @param bool|JsExp $bool 是否是js表达式
     * @return $this
     */
    public function appear(bool|JsExp $bool = true): static
    {
        return $this->prop('appear', $bool);
    }

    /**
     * 设置组件是否展示
     * @param bool|JsExp $value
     * @return $this
     */
    public function show(bool|JsExp $value): static
    {
        return $this->prop('show', $value);
    }
}
